package cn.base.demo2;

import java.util.Scanner;

public class Code06 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入机票原价：");
        double oldPerice = sc.nextDouble();
        System.out.print("请输入您购票的月份：");
        int month = sc.nextInt();
        System.out.print("请输入您所乘坐的航班类型：");
        String plane = sc.next();
        if (plane.equals("头等舱")) {
            if (month >= 5 && month <= 10) {
                oldPerice *= 0.9;
                System.out.println(plane + "旺季票价为：" + oldPerice);
            }
            if ((month >= 11 && month <= 12) && (month >= 0 && month <= 4)) {
                oldPerice *= 0.7;
                System.out.println(plane + "淡季票价为：" + oldPerice);
            }
        }
        if (plane.equals("经济舱")) {
            if (month >= 5 && month <= 10) {
                oldPerice *= 0.85;
                System.out.println(plane + "旺季票价为：" + oldPerice);
            }
            if ((month >= 11 && month <= 12) && (month >= 0 && month <= 4)) {
                oldPerice *= 0.65;
                System.out.println(plane + "淡季票价为：" + oldPerice);
            }
        }


    }
}
